#ifndef __I_MODULE_H_
#define __I_MODULE_H_
#include "ModulesProxy.h"
#include <string>
#include <memory>
#include <chrono>
#include <optional>

namespace sdk {
namespace msg {
namespace mod {
enum class ModuleName {
    RTSP,
    PULSETAKING,
    BLOODGENERATOR
};

class IModule {
public:
    static std::shared_ptr<IModule> create(ModuleName name, ModulesProxy &proxy, const std::string &msgId, const WsSession &session);

    IModule(ModulesProxy &proxy, const std::string &msgId, const WsSession &session);

    virtual bool doDirective(std::shared_ptr<std::string> binptr, std::optional<std::chrono::steady_clock::time_point> endtime, uint32_t retryIdx) = 0;
    virtual ~IModule() {}

public:
    ModulesProxy &m_proxy;
    std::string m_msgId;
    WsSession m_session;
    bool m_validSession;
};

} // namespace mod
} // namespace msg
} // namespace sdk

#endif // __I_MODULE_H_